
package de.swta.freezay.database.utilities;

import de.swta.freezay.database.JPAController;
import de.swta.freezay.database.dbEntities.Package;
import java.util.List;

/**
 * --- ONLY FOR DEVELOPING/TESTING PURPOSE ---
 *
 * @author Christian Baeumer
 */
public class DBViewer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        
        List<Package> packages 
                = JPAController.PackageJpaController.findPackageEntities();

        System.out.println("NAME\t\t\t\tCATEGORY\t\t\t\t\tDESCRIPTION\t\t\t\t\t"
                + "PRICE\t\t\t\t\tDISCOUNT\t\t\t\t\tVALIDITY\t\t\t\t\tITEMS");

        for (Package p : packages) {
            System.out.print(p.getName() + "\t\t\t");
            System.out.print(p.getCategory().getName() + "\t\t\t\t\t");
            System.out.print(p.getDescription() + "\t\t\t");
            System.out.print(p.getPrice() + "\t\t\t\t");
            System.out.print(p.getDiscount() + "\t\t\t\t");
            System.out.print(p.getValidity() + "\t\t\t\t\t");

//            List<ItemPackage> ip = p.getItemPackageCollection();
//
//            for (ItemPackage o : ip) {
//                o.
//            }
//
//            List<Item> items = p.getItemCollection();
//
//            for (Item i : items) {
//                System.out.print(i.getName() + ",");
//            }
//            System.out.println("");
        }
       

//        System.out.println("NAME\t\t\t\tCATEGORY\t\t\t\t\tDESCRIPTION\t\t\t\t\t"
//                + "PRICE\t\t\t\t\tDISCOUNT\t\t\t\t\tVALIDITY\t\t\t\t\tITEMS");
//
//        for (Package p : packages) {
//            System.out.print(p.getName() + "\t\t\t");
//            System.out.print(p.getCategory().getName() + "\t\t\t\t\t");
//            System.out.print(p.getDescription() + "\t\t\t");
//            System.out.print(p.getPrice() + "\t\t\t\t");
//            System.out.print(p.getDiscount() + "\t\t\t\t");
//            System.out.print(p.getValidity() + "\t\t\t\t\t");
//
//            List<Item> items = p.getItemCollection();
//
//            for (Item i : items) {
//                System.out.print(i.getName() + ",");
//            }
//            System.out.println("");
//        }

        
    }

}
